package org.light.generator;

import java.util.ArrayList;
import java.util.List;

import org.light.core.Writeable;
import org.light.domain.Domain;
import org.light.domain.Statement;
import org.light.domain.StatementList;
import org.light.utils.DomainUtil;
import org.light.utils.WriteableUtil;

public class CargoTomlGenerator extends Generator{
	protected List<Domain> domains = new ArrayList<>();
	protected String projectName;
	protected String edition;
	public String getProjectName() {
		return projectName;
	}

	public void setProjectName(String projectName) {
		this.projectName = projectName;
	}

	public String getEdition() {
		return edition;
	}

	public void setEdition(String edition) {
		this.edition = edition;
	}

	public List<Domain> getDomains() {
		return domains;
	}

	public void setDomains(List<Domain> domains) {
		this.domains = domains;
	}

	public CargoTomlGenerator(){
		super();
		super.fileName = "Cargo.toml";
		super.standardName = "CargoToml";
	}

	@Override
	public StatementList generateStatementList() {
		List<Writeable> sList = new ArrayList<Writeable>();
		sList.add(new Statement(1000L,0,"[package]"));
		sList.add(new Statement(2000L,0,"name = \""+this.projectName+"\""));
		sList.add(new Statement(3000L,0,"version = \"0.1.0\""));
		sList.add(new Statement(4000L,0,"edition = \"2021\""));
		sList.add(new Statement(5000L,0,""));
		sList.add(new Statement(6000L,0,"# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html"));
		sList.add(new Statement(7000L,0,"[dependencies]"));
		sList.add(new Statement(8000L,0,"axum =  \"0.4.8\""));
		sList.add(new Statement(9000L,0,"tokio = { version = \"1.0\", features = [\"full\"] }"));
		sList.add(new Statement(10000L,0,"tracing = \"0.1\""));
		sList.add(new Statement(11000L,0,"tracing-subscriber = { version=\"0.3\", features = [\"env-filter\"] }"));
		sList.add(new Statement(12000L,0,"tower-http = { version = \"0.2.0\", features = [\"fs\", \"trace\"] }"));
		sList.add(new Statement(13000L,0,""));
		sList.add(new Statement(14000L,0,"sqlx = { version = \"0.3.5\", features = [\"mysql\"] }"));
		sList.add(new Statement(15000L,0,"serde = { version = \"1.0.117\", features = [\"derive\"] }"));
		sList.add(new Statement(16000L,0,"serde_json = \"1.0\""));
		sList.add(new Statement(17000L,0,"uuid = { version = \"0.8.1\", features = [\"serde\", \"v4\"] }"));
		sList.add(new Statement(18000L,0,"http = \"0.2.1\""));
		sList.add(new Statement(19000L,0,"blob = \"0.3.0\""));
		sList.add(new Statement(20000L,0,"base64 = \"0.12.1\""));

		return WriteableUtil.merge(sList);
	}

}
